package com.example.wyz.classplus.ui.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.wyz.classplus.R;
import com.example.wyz.classplus.base.BaseFragment;
import com.example.wyz.classplus.contract.fgm.CounsellorNoticeListContract;
import com.example.wyz.classplus.presenter.CounsellorNoticeListPresenter;
import com.example.wyz.classplus.ui.adapter.CounsellorNoticeListAdapter;

import butterknife.BindView;

/**
 * Created by 10153 on 2017/6/1.
 */

public class CounsellorNoticeListFragment extends BaseFragment<CounsellorNoticeListContract.Presenter>
        implements CounsellorNoticeListContract.View{

    private CounsellorNoticeListAdapter adapter;

    @BindView(R.id.rec_msg_notice) RecyclerView mCounsellorNotice;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState) {
        View view = super.onCreateView(inflater, container, savedInstanceState);
        initRecyclerView();
        return view;
    }

    @Override
    protected void initPresenter() {
        mPresenter = new CounsellorNoticeListPresenter(this.mContext, this);
    }

    @Override
    protected int getLayout() {
        return R.layout.fragment_campus_notice;
    }

    private void initRecyclerView(){
        adapter = new CounsellorNoticeListAdapter(this.mContext);
        mCounsellorNotice.setLayoutManager(new LinearLayoutManager(this.mContext));
        mCounsellorNotice.setAdapter(adapter);
    }
}
